<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/25
 * Time: 17:04
 */

use yii\helpers\Html;
use yii\grid\GridView;
use backend\assets\AppAsset;
use kartik\file\FileInput;
use leandrogehlen\treegrid\TreeGrid;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\ProjectSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '分类管理';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="category-index">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-solid">
                <div class="box-header with-border"></div>
                <div class="box-body">
                    <p>
                        <?= Html::a('添加分类', ['create'], ['class' => 'btn btn-success']) ?>
                    </p>
                    <?= TreeGrid::widget([
                        'dataProvider' => $dataProvider,
                        'keyColumnName' => 'id',
                        'parentColumnName' => 'parent_id',
                        'columns' => [
                            'id',
                            'name',
                            'parent_id',
                            ['class' => 'yii\grid\ActionColumn']
                        ]
                    ]); ?>
                </div>
            </div>
        </div>
    </div>
</div>
